home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / SOURCE.BIN / HorizontalSpinButtonPanel.java < prev    next >
Encoding:
Java Source  |  1997-06-19  |  1.4 KB  |  48 lines

  1. package symantec.itools.awt;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Graphics;
  5. import java.awt.Polygon;
  6.  
  7. /**
  8.  * This component groups the two spin buttons horizontally. It is used for 
  9.  * spinners with the ORIENTATION_HORIZONTAL attribute set.
  10.  * @see Spinner
  11.  * @see Orientation
  12.  * @version 1.0, Nov 26, 1996
  13.  * @author Symantec
  14.  */
  15.  
  16. public class HorizontalSpinButtonPanel
  17.     extends SpinButtonPanel
  18. {
  19.     /**
  20.      * Constructs the default HorizontalSpinButtonPanel.
  21.      */
  22.     public HorizontalSpinButtonPanel()
  23.     {
  24.         resize(32, 16);
  25.     }
  26.  
  27.     /**
  28.      * Moves and/or resizes this component.
  29.      * This is a standard Java AWT method which gets called to move and/or 
  30.      * resize this component. Components that are in containers with layout
  31.      * managers should not call this method, but rely on the layout manager
  32.      * instead.
  33.      * It is reshapes the two direction buttons so they both fit within the
  34.      * panels new shape.
  35.      * 
  36.      * @param x horizontal position in the parent's coordinate space
  37.      * @param y vertical position in the parent's coordinate space
  38.      * @param width the new width
  39.      * @param height the new height
  40.      */
  41.     public void reshape(int x, int y, int width, int height)
  42.     {
  43.         incButton.reshape(width / 2, 0, width / 2, height);
  44.         decButton.reshape(0, 0, width / 2, height);
  45.  
  46.         super.reshape(x, y, width, height);
  47.     }
  48. }